/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * fmPrincipal.java
 *
 * Created on 19/04/2011, 20:20:35
 */

package sistema;

import java.awt.Dimension;

/**
 *
 * @author Alexander
 */
public class fmPrincipal extends javax.swing.JFrame {

    /** Creates new form fmPrincipal */
    public fmPrincipal() {
        initComponents();     
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        mCliente = new javax.swing.JMenuItem();
        mTransporte = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenu1.setText("Cadastro");

        mCliente.setText("Cliente");
        mCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mClienteActionPerformed(evt);
            }
        });
        jMenu1.add(mCliente);

        mTransporte.setText("Transporte");
        mTransporte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mTransporteActionPerformed(evt);
            }
        });
        jMenu1.add(mTransporte);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Consulta");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1263, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 698, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mClienteActionPerformed
        // TODO add your handling code here:
        fmCliente cli = new fmCliente();
        cli.setVisible(true);
        Dimension  paneSize = cli.getSize();
        Dimension  screenSize = cli.getToolkit().getScreenSize();
        cli.setLocation((screenSize.width - paneSize.width) / 2,(screenSize.height - paneSize.height) / 2);
    }//GEN-LAST:event_mClienteActionPerformed

    private void mTransporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mTransporteActionPerformed
        // TODO add your handling code here:
        fmTransporte trans = new fmTransporte();
        trans.setVisible(true);
        Dimension  paneSize = trans.getSize();
        Dimension  screenSize = trans.getToolkit().getScreenSize();
        trans.setLocation((screenSize.width - paneSize.width) / 2,(screenSize.height - paneSize.height) / 2);
    }//GEN-LAST:event_mTransporteActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new fmPrincipal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem mCliente;
    private javax.swing.JMenuItem mTransporte;
    // End of variables declaration//GEN-END:variables

}
